package com.woniu.car.mapper;

import com.woniu.car.domain.TSpec;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.car.dto.QueryGoodsAllSpec;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 规格组 Mapper 接口
 * </p>
 *
 * @author chestnuts
 * @since 2021-06-21
 */
@Mapper
public interface TSpecMapper extends BaseMapper<TSpec> {

    @Select("select t_spec.spec_id,spec_name,spec_value,t_spec_value.spec_value_id from t_spec JOIN t_spec_value ON  t_spec.spec_id=t_spec_value.spec_id WHERE category_id = #{categoryId}")
    List<QueryGoodsAllSpec> getSpeces(Integer categoryId);

}
